import request from '@/config/axios'

export interface EvaluateVO {
  id: number
  code: string
  remark: string
  star: number
  memberCode: string
  orderCode: string
  userCode: string
  memberName: string
}

// 查询用户评价分页
export const getEvaluatePage = async (params) => {
  return await request.get({ url: `/meijia/evaluate/page`, params })
}

// 查询用户评价详情
export const getEvaluate = async (id: number) => {
  return await request.get({ url: `/meijia/evaluate/get?id=` + id })
}

// 新增用户评价
export const createEvaluate = async (data: EvaluateVO) => {
  return await request.post({ url: `/meijia/evaluate/create`, data })
}

// 修改用户评价
export const updateEvaluate = async (data: EvaluateVO) => {
  return await request.put({ url: `/meijia/evaluate/update`, data })
}

// 删除用户评价
export const deleteEvaluate = async (id: number) => {
  return await request.delete({ url: `/meijia/evaluate/delete?id=` + id })
}

// 导出用户评价 Excel
export const exportEvaluate = async (params) => {
  return await request.download({ url: `/meijia/evaluate/export-excel`, params })
}